<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%@ page contentType="text/html;charset=UTF-8" isELIgnored="false" language="java" %>
<html>
<head>
    <title>Title</title>
    <script>
        function delGoods(gid) {
            alert(gid);
            if (confirm("你确定以及肯定要删除这个产品么？")){
                location.href="../goods?type=delete&id="+gid;
            }
        }
    </script>
</head>
<body>
<form>
    <table border="1" align="center" width="80%">
        <caption><a href="index.jsp">继续购物</a></caption>
        <tr>
            <td>序号</td>
            <td>名称</td>
            <td>价格</td>
            <td>数量</td>
            <td>操作</td>
        </tr>
        <c:set var="sum" value="0"/>
        <c:forEach var="gi" varStatus="j" items="${GWC_LIST}">
            <tr>
                <td>${j.count}</td>
                <td>${gi.goodsName}</td>
                <td>${gi.goodsPrice}</td>
                <td>${gi.goodsUnm}</td>
                <td><a href="javascript:delGoods(${gi.goodsId})">删除</a></td>
            </tr>
            <c:set value="${sum+gi.goodsPrice*gi.goodsUnm}" var="sum"/>
        </c:forEach>
        <tr>
            <td colspan="5">
                总价：<label style="color: darkred ;font-size: 2em;">${sun}</label>
            </td>
        </tr>
    </table>
</form>
</body>
</html>
